package com.myblog.controller;


import com.myblog.common.lang.Result;
import com.myblog.entity.Project;
import com.myblog.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author From:星羽恒
 * @since 2021-11-24
 */
@RestController
@RequestMapping("/project")
public class ProjectController {
    @Autowired
    ProjectService projectService;

    @GetMapping("")
    public Result getProjects(){
        List<Project> projects = projectService.list();
        return Result.succ(projects);
    }
}
